]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
autorunManager: Avoid access to non-existent array element
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 17 Sep 2017 09:37:52 +0000 (11:37 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 19 Sep 2017 18:07:21 +0000 (20:07 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=787907

js/ui/components/autorunManager.js

index de0fda7a00a4cc81100dc182c062eb733902df05..ac09ae827886cb8f457118dbcdbb6f407209337f 100644 (file)
@@ -255,7 +255,11 @@ var AutorunDispatcher = new Lang.Class({
         if (!shouldAutorunMount(mount))
             return;
 
-        let setting = this._getAutorunSettingForType(contentTypes[0]);
+        let setting;
+        if (contentTypes.length > 0)
+            setting = this._getAutorunSettingForType(contentTypes[0]);
+        else
+            setting = AutorunSetting.ASK;
 
         // check at the settings for the first content type
         // to see whether we should ask